<?php

namespace Sofical\Restphp\utils;

/**
 * Filter management.
 */
class RestFilterManage {
    /**
     * Register filter.
     * @param $className
     * @param $methodName
     * @return void
     */
    public static function register($className, $methodName) {
        $GLOBALS['_FILTER'] = isset($GLOBALS['_FILTER']) ? $GLOBALS['_FILTER'] : array();
        $GLOBALS['_FILTER'][] = array(
            'class' => $className,
            'function' => $methodName
        );
    }

    /**
     * Get filters.
     * @return array
     */
    public static function getFilters(){
        return isset($GLOBALS['_FILTER']) ? $GLOBALS['_FILTER'] : array();
    }
}